home *** CD-ROM | disk | FTP | other *** search
/ Eagles Nest BBS 8 / Eagles_Nest_Mac_Collection_Disc_8.TOAST / Developer Tools⁄Additions / CProgramStrt / TC Prog Guide / TC Prog Guide / card_63085.txt < prev    next >
Encoding:
Text File  |  1991-02-27  |  3.6 KB  |  136 lines

  1. -- card: 63085 from stack: in
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 4755
  5. -- name: 
  6.  
  7.  
  8. -- part 1 (field)
  9. -- low flags: 00
  10. -- high flags: 0007
  11. -- rect: left=30 top=78 right=296 bottom=478
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 0
  15. -- font id: 4
  16. -- text size: 9
  17. -- style flags: 0
  18. -- line height: 12
  19. -- part name: 
  20.  
  21.  
  22. -- part 2 (button)
  23. -- low flags: 00
  24. -- high flags: 0001
  25. -- rect: left=13 top=29 right=57 bottom=351
  26. -- title width / last selected line: 0
  27. -- icon id / first selected line: 0 / 0
  28. -- text alignment: 1
  29. -- font id: 0
  30. -- text size: 12
  31. -- style flags: 0
  32. -- line height: 16
  33. -- part name: New Button
  34.  
  35.  
  36. -- part contents for background part 7
  37. ----- text -----
  38. 205
  39.  
  40. -- part contents for background part 4
  41. ----- text -----
  42. File 1 of 3.  A TC abstract class for graphics and a derived Macintosh-specific version:
  43.  
  44. -- part contents for card part 1
  45. ----- text -----
  46. /*
  47. *   FILE:     screen.h
  48. *   AUTHOR:   R. Gonzalez
  49. *   CREATED:  Aug. 5, 1990
  50. *
  51. *   Definition of Screen and Mac_Screen classes, to isolate
  52. *   graphics code.  These use a console window for stdio I/O and
  53. *   a graphics window using a user-defined view coordinate
  54. *   system.  The transform_x() and transform_y() methods
  55. *   translate into screen coordinates for use by machine
  56. *   -dependent drawing routines.
  57. */
  58.  
  59. # define   _H_screen
  60.  
  61. typedef    int        boolean;
  62. # define   TRUE       1
  63. # define   FALSE      0
  64.  
  65. # define   BLACK      0
  66. # define   WHITE      1
  67. # define   RED        1
  68. # define   YELLOW     1
  69. # define   GREEN      1
  70. # define   BLUE       1
  71. # define   CYAN       1
  72. # define   MAGENTA    1
  73.  
  74. /******************************************************************
  75. *   Screen abstract class to isolate graphics I/O
  76. ******************************************************************/
  77. struct   Screen:indirect   /* or use Generic_Class */
  78. {
  79.     int     screen_width,
  80.             screen_height,
  81.             present_color;
  82.     double  view_width,
  83.             view_height,
  84.             view_x,
  85.             view_y;
  86.  
  87.     boolean init(void);
  88.     void    graphics_to_front(void);
  89.     void    console_to_front(void);
  90.     double  get_aspect_ratio(void);
  91.     void    set_view(double,double,double,double);
  92.     int     transform_x(double);
  93.     int     transform_y(double);
  94.     void    cursor_on(void);
  95.     void    cursor_off(void);
  96.     void    color(int);
  97.     void    erase_graphics(void);
  98.     void    draw_line(double,double,double,double);
  99.     void    move_to(double,double);
  100.     void    draw_to(double,double);
  101.     void    draw_circle(double,double,double);
  102.     void    fill_circle(double,double,double);
  103.     boolean mouse_button_is_down(void);
  104.     void    get_mouse_location(double*,double*);
  105.     void    wait(void);
  106. };
  107.  
  108. /******************************************************************
  109. *   Mac_Screen class to allow graphics I/O on Macintosh computers
  110. ******************************************************************/
  111. struct   Mac_Screen:Screen
  112. {
  113.     WindowPtr   graphics_window,
  114.                 console_window;
  115.     CursHandle  CrossCursor;
  116.  
  117.     boolean init(void);
  118.     void    graphics_to_front(void);
  119.     void    console_to_front(void);
  120.     void    cursor_on(void);
  121.     void    cursor_off(void);
  122.     void    color(int);
  123.     void    erase_graphics(void);
  124.     void    move_to(double,double);
  125.     void    draw_to(double,double);
  126.     void    draw_circle(double,double,double);
  127.     void    fill_circle(double,double,double);
  128.     boolean mouse_button_is_down(void);
  129.     void    get_mouse_location(double*,double*);
  130. };
  131.  
  132.  
  133.  
  134. -- part contents for background part 6
  135. ----- text -----
  136. Portable graphics class and Macintosh version